//
//  CIBNHomePageScrollCell.m
//  CIBN
//
//  Created by ZNGOO on 16/7/19.
//  Copyright © 2016年 韦儒健. All rights reserved.
//

#import "CIBNHomePageScrollCell.h"

@interface CIBNHomePageScrollCell()
@property (nonatomic,strong)NSArray * array;

@end
@implementation CIBNHomePageScrollCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        
    }
    return self;
}

- (void)setScrollViewImageArr:(NSArray*)array{
    
    self.array = array;
    
    NSMutableArray * imageArray = [[NSMutableArray alloc] init];
    for (int index = 0; index < array.count; index++) {
        CIBNHomeListModel * model = array[index];
        [imageArray addObject:[NSString stringWithFormat:@"http://42.62.117.43:8080/play?fid=%@",model.img]];
    }
    
    self.scrollView = [[RJScrollPageView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height) WithNetImages:imageArray];
    self.scrollView.AutoScrollDelay = 3.0;
    self.scrollView.netDelagate = self;
    [self addSubview:self.scrollView];
}
-(void)didSelectedNetImageAtIndex:(NSInteger)index{
    NSLog(@"%ld",index);
    CIBNHomeListModel * model = self.array[index];
    
    self.pushPlayVCBlock(model);
}
@end
